<template>
  <div class="nav">
      <button @click="goto('A')">go to A</button>
      <button @click="goto('B')">go to B</button>
      <button @click="goto('C')">go to C</button>
  </div>
</template>
<script>
    export default {
        name:'myNav',
        methods:{
            goto(index){
                switch(index){
                    case 'A':
                      this.$router.push({
                        path:  '/'
                      });
                      break;
                    case 'B':
                      this.$router.push({
                        path:  '/b'
                      });
                      break;
                    case 'C':
                     this.$router.push({
                        path:  '/c'
                      });
                      break;
                }
            }
        }
    }
</script>
<style>

</style>

